package com.atguigu.reggie.common;

/**
 * @author Luo Sheng
 * @school YiBin university
 * @create 2022-10-11 16:01
 */

import java.util.TreeMap;

/**
 * 基于TreadLocal封装工具，用户保存和获取当前登陆用户的Id
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 设置Set方法
     * @param id
     */
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }


}
